<template>
  <div class="person">
    <h1>我是Person组件</h1>
    <h2>名字：{{name}}</h2>
    <h2>年龄：{{age}}</h2>
    <h2>座驾：{{car}}</h2>
    <button @click="test">点我输出Person的vc</button><br>
    <button @click="name = 'tony'">点我修改名字</button>
    <button @click="age = 99">点我修改年龄</button>
    <button @click="car.price = '100W'">点我修改车的价格</button>
    <button @click="car = {name:'奥拓',price:'9500'}">点我修改整个车</button>
  </div>
</template>

<script>
  export default {
    name:'Person',
    props:['name','age','car'],
    methods: {
      test(){
        console.log('Person',this)
      }
    },
  }
</script>

<style scoped>
  .person {
    background-color: orange;
    padding: 20px;
    box-shadow: 0 0 10px black;
    border-radius: 10px;
  }
</style>